package com.sctvcloud.bazhong.ui.activities;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;

import com.sctvcloud.bazhong.R;
import com.sctvcloud.bazhong.base.BaseActivity;
import com.sctvcloud.bazhong.ui.utils.TitleUtils;

import butterknife.BindView;
import butterknife.OnClick;

public class ModifyAddressActivity extends BaseActivity {

    @BindView(R.id.modify_addr_name)
    protected EditText etName;
    @BindView(R.id.modify_addr_phone)
    protected EditText etphone;
    @BindView(R.id.modify_addr_addr)
    protected EditText etAddr;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        new TitleUtils(this).useAndSetTxTitle(R.string.new_address);
    }

    @Override
    protected void initInject() {
        initButterknifeBiner(R.layout.activity_modify_address);
    }

    @OnClick(value = R.id.modify_addr_save)
    public void btnClick(View v){
        save();
    }

    private void save(){
        String name=etName.getText().toString();
        if (TextUtils.isEmpty(name)){
            toast(R.string.please_input_name);
            return;
        }
        String phone=etphone.getText().toString();
        if (TextUtils.isEmpty(phone)){
            toast(R.string.please_input_phone);
            return;
        }
        String address=etAddr.getText().toString();
        if (TextUtils.isEmpty(address)){
            toast(R.string.please_input_address);
            return;
        }
    }
}
